<template>
  <div class="yj-home">
    <component :is="layoutComponent">
      <router-view></router-view>
    </component>
  </div>
</template>

<script lang="ts" setup>
import Layout from "./views/common/layout.vue";
import LayoutNoMenu from './views/common/noMenu.vue';
import LayoutEmpty from './views/common/empty.vue';
import { computed } from "vue";
import { useRoute } from 'vue-router';
const route:any = useRoute();
const layoutComponent = computed(() => {
  const [, layoutComponent] = [
    [['resourcePlay'], LayoutNoMenu],
    [['view'], LayoutEmpty]
  ].find(([routeNames]) => routeNames.find((name:any) => {
    return route.name && route.name.substr(0, name.length) === name;
  })) || ['default', Layout]
  return layoutComponent
})
</script>

<style lang="scss">
@import 'style/common/common.scss';
@import 'style/common/theme.scss';
</style>
